# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=rtl-power-fftw
pkgver=20200601
_commit="cee9a22207ea995bd12adbc6bcfbec92521548b1"
pkgrel=3
pkgdesc="A program that obtains a power spectrum from RTL devices using FFTW"
url="https://github.com/AD-Vega/rtl-power-fftw"
arch="all"
license="GPL-3.0-only"
makedepends="
	cmake
	fftw-dev
	libusb-dev
	librtlsdr-dev
	samurai
	tclap-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/AD-Vega/rtl-power-fftw/archive/$_commit.tar.gz
	missing-cstdint.patch
	"
subpackages="$pkgname-doc"
options="!check" # no tests provided
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-Wno-dev
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
1d7db0df54b84a38bf8024558b42657a00f6432912ea1d4312d8c83fc0147f3a912df529e16db63dedc07518161cd9c7b96c969c53dde374a1b270d15e721189  rtl-power-fftw-20200601.tar.gz
60ecfc0aaf03bd6589fab7c040b40be74c10b4ab0f5bffa95f8f2845d7f3fb55f07b950253ab7785825f8da2038ad98941d89d20734a951fe45bb55a2091943a  missing-cstdint.patch
"
